﻿Public Class ViewParametrerNouveauGroupe

    Private Sub BtCreerGroupeArtificiel_Click(sender As Object, e As Windows.RoutedEventArgs) Handles BtCreerGroupeArtificiel.Click

        Dim inputdata As New ViewModelInputBox
        inputdata.Value = ""
        PMTModule.UIService.ShowMessage(inputdata, WindowTitle:="Entrez le  nom du groupe", ShowCloseButton:=False)
        Dim vm As ViewModelParametrerNouveauGroupe = DataContext
        Dim datamanager As New DataManager

        If Not String.IsNullOrEmpty(inputdata.Value.Trim().Replace(" ", "").ToUpper()) Then
            If Not vm._ListeGroupesArtificiels.Contains(inputdata.Value.Trim().Replace(" ", "").ToUpper()) Then
                vm._ListeGroupesArtificiels.Add(inputdata.Value.Trim().Replace(" ", "").ToUpper())

                Dim table As DataModel.PmtDataset.NouveauGroupeDataTable = vm.ListeNouveauGroupe.Table
                table.AddNouveauGroupeRow( _
                    inputdata.Value.Trim().Replace(" ", "").ToUpper(), _
                    "DC", _
                    datamanager.AnneeReference + 1, _
                    1)

                'NouveauGroupeArtificielGrid.Visibility = _
                '    If(NouveauGroupeArtificielGrid.Visibility = Windows.Visibility.Collapsed, Windows.Visibility.Visible, Windows.Visibility.Collapsed)
            End If
        End If

    End Sub

End Class
